package com.qwz.example;

import com.qwz.example.colleague.CDDriver;
import com.qwz.example.colleague.CPU;
import com.qwz.example.colleague.SoundCard;
import com.qwz.example.colleague.VideoCard;
/**  
* @Description: 中间件模式客户端
* @Package com.qwz.example.Client
* @author Qiuwuzhi
* @date 2019/12/24 14:57
* @version V1.0
*/
public class Client {
    public static void main(String[] args) {
        //创建中介者-主板对象
        MotherBoard mediator = new MotherBoard();
        //创建同事类
        CDDriver cdDriver = new CDDriver(mediator);
        CPU cpu = new CPU(mediator);
        VideoCard videoCard = new VideoCard(mediator);
        SoundCard soundCard = new SoundCard(mediator);

        mediator.setCdDriver(cdDriver);
        mediator.setCpu(cpu);
        mediator.setSoundCard(soundCard);
        mediator.setVideoCard(videoCard);

        cdDriver.readCD();
    }
}
